﻿<%@ Page Language="C#" MasterPageFile="~/INFTUR.master" AutoEventWireup="true" CodeBehind="VenderPassagem.aspx.cs" Inherits="INFTUR.VenderPassagem" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">    <div id="principal">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div style="width:400px">
        <div id="consulta">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataSourceID="odsVPassagem" Width="566px" 
                HorizontalAlign="Justify" 
                onselectedindexchanged="GridView1_SelectedIndexChanged" 
                style="margin-top: 0px">
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Codigo" SortExpression="Id" />
                    <asp:BoundField DataField="CBO" HeaderText="Cliente" SortExpression="CBO" />
                    <asp:TemplateField HeaderText="Atualizar">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click">Atualizar</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Remover">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click">Remover</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="odsVPassagem" runat="server" DeleteMethod="Remove" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="ConsultaTodos" TypeName="Negocios.VendaPassagemBOMetodos">
                <DeleteParameters>
                    <asp:Parameter Name="id" Type="Int32" />
                </DeleteParameters>
            </asp:ObjectDataSource>
        </div>
        
        <div id="cadastro" class="divDados" style="width:400px">
        <table>
            <tr>
            <td>
                <asp:Label ID="codigo" runat="server" Text="Codigo:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBcodigo" runat="server" MaxLength="11"></asp:TextBox>
&nbsp;
                <asp:Button ID="novavenda" runat="server" onclick="novavenda_Click" 
                    Text="Vender Passagem" />
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="cliente" runat="server" Text="Cliente:"></asp:Label>
                </td>
            <td>
                        <asp:DropDownList ID="dlCliente" runat="server" 
                            DataTextField="Nome" DataValueField="Cpf" Height="16px" Width="123px" 
                            DataSourceID="ObjectDataSource1">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                    DataObjectTypeName="Negocios.ClienteBO" DeleteMethod="Remove" 
                    InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                    TypeName="Negocios.ClienteBOMetodos" UpdateMethod="Atualiza">
                            <DeleteParameters>
                                <asp:Parameter Name="cpf" Type="String" />
                            </DeleteParameters>
                        </asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="preco" runat="server" Text="Preço:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBpreco" runat="server" MaxLength="100"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="companhia" runat="server" Text="Companhia:"></asp:Label>
                </td>
            <td>
                <asp:DropDownList ID="DCompanhia" runat="server">
                    <asp:ListItem>alpha</asp:ListItem>
                    <asp:ListItem>beta</asp:ListItem>
                </asp:DropDownList>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="dataIda" runat="server" Text="Data de Ida:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBdataIda" runat="server" style="margin-left: 1px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="dataVolta" runat="server" Text="Data de Volta:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBdataVolta" runat="server" style="margin-left: 1px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="classe" runat="server" Text="Classe:"></asp:Label>
                </td>
            <td>
                <asp:DropDownList ID="Dclasse" runat="server">
                    <asp:ListItem>1</asp:ListItem>
                    <asp:ListItem Value="2">2</asp:ListItem>
                    <asp:ListItem>3</asp:ListItem>
                </asp:DropDownList>
                </td>
            </tr>
            <tr>
            <td colspan="2">
                <asp:Button ID="gravar" runat="server" Enabled="False" onclick="gravar_Click" 
                    Text="Gravar/Alterar" />
&nbsp;&nbsp;&nbsp;
                <asp:Button ID="cancelar" runat="server" Enabled="False" 
                    onclick="cancelar_Click" Text="Cancelar" />
                </td>
            </tr>
        </table>
            <br />
            <br />
            <asp:Label ID="Lerro" runat="server"></asp:Label>
        </div>
    </div>
</div>
</asp:Content>